<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddTranslateFieldToTopics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('topics', function (Blueprint $table) {
            $table->tinyInteger('translate_status')->default(0)->comment('翻译状态: 0.不需翻译 1.未翻译 2.已翻译');
            $table->string('original_url', 255)->nullable()->comment('原文地址');
            $table->string('translation_url', 255)->nullable()->comment('译文地址');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('topics', function (Blueprint $table) {
            //
            $table->dropColumn('translate_status');
            $table->dropColumn('original_url');
            $table->dropColumn('translation_url');
        });
    }
}
